package com.wuxin.config;


import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @program: jinrongxiangmu
 * @ClassName MyBatisPlusConfig
 * @description:
 * @author: 李尧坤
 * @create: 2025−01-13 20:14
 * @Version 1.0
 **/

@Configuration
@MapperScan("com.wuxin.mapper")
@EnableTransactionManagement//启用事务
public class MyBatisPlusConfig {

    //添加分页插件
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }


}
